Socket
Socket
Sign inDemoInstall

read-package-up

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-package-up

Read the closest package.json file


Version published
Maintainers
1
Created

What is read-package-up?

The 'read-package-up' npm package is a utility that helps you read the closest package.json file, starting from a specified directory and traversing upwards. It is useful for tasks that require information from the package.json file, such as versioning, dependency management, and configuration.

What are read-package-up's main functionalities?

Read the closest package.json

This feature allows you to read the closest package.json file starting from the current directory and moving upwards. The result includes the path to the package.json file and its contents.

const readPackageUp = require('read-package-up');

(async () => {
  const result = await readPackageUp();
  console.log(result);
})();

Specify a starting directory

This feature allows you to specify a starting directory from which the search for the closest package.json file will begin. This is useful if you want to start the search from a specific location rather than the current working directory.

const readPackageUp = require('read-package-up');

(async () => {
  const result = await readPackageUp({ cwd: '/path/to/start/directory' });
  console.log(result);
})();

Other packages similar to read-package-up

Keywords

FAQs

Package last updated on 04 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc